fix(ui5-shellbar-search): keep ShellBar state in sync on empty Enter#13834
Open
dobrinyonkov wants to merge 1 commit into
Open
fix(ui5-shellbar-search): keep ShellBar state in sync on empty Enter#13834dobrinyonkov wants to merge 1 commit into
dobrinyonkov wants to merge 1 commit into
Conversation
Pressing Enter in an empty, expanded shellbar search collapsed the search field internally via `this.collapsed = true`, but skipped `super._handleEnter()` and therefore never fired the `ui5-search` event. The ShellBar tracks the search's expanded/collapsed state separately through its search adaptor, which only reacts to `ui5-open`/`ui5-close`/`ui5-search`. As a result the field collapsed visually while the ShellBar remained in its expanded layout. The empty-Enter branch now fires `ui5-search` before collapsing locally. When embedded in a ShellBar, the adaptor toggles `showSearchField` and the next render syncs `collapsed`, so both stay aligned. Standalone usage still self-collapses and restores focus to the button as before.
dobrinyonkov
force-pushed
the
fix/shellbar-search-enter-sync
branch
from
July 16, 2026 11:08
a94a003 to
f6a5f47
Compare
MapTo0
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SNOW: DINC0942674
Problem
Focus the shellbar search (empty, expanded) and press Enter. The search field collapses to an icon, but the ShellBar keeps its expanded layout. The two get out of sync.
Cause
ShellBarSearch._handleEnter()(added in #13523) collapses the field on empty Enter by settingthis.collapsed = truedirectly. It skipssuper._handleEnter(), so theui5-searchevent never fires.The ShellBar tracks the search state separately through its adaptor, which only reacts to
ui5-open,ui5-close, andui5-search. With no event, the adaptor never learns the field collapsed, soshowSearchFieldstaystrue.Fix
Fire
ui5-searchbefore collapsing. The adaptor then flipsshowSearchFieldtofalse, so both stay in sync. Standalone usage still self-collapses and restores focus to the button.Tests
Added a test in
ShellBar.cy.tsx: mount the search inside a ShellBar, press Enter on empty, and check bothcollapsed === trueandshowSearchField === false. The existing standalone test from #13523 still passes.